#include <iostream>
#include <vector>
#include <cstdlib>
#include <ctime>
using namespace std;

int const avg = 1;

int main()
{
	std::srand(std::time(0));
	int n = 1000;
	cout << "1\n" << n << '\n';
	std::vector<int> a(n);
	while (true) {
		for (int i = 0 ; i < n; i++) a[i] = avg;
		int m = rand() % (n/2 - 1) + 1;
		for (int i = 0; i < m; i++) a[rand() % n]--;
		for (int i = 0; i < m; i++) a[rand() % n]++;
		bool mark = false;
		for (int i = 0; i < n; i++)
			if (a[i] < 0) { mark = true; break; }
		if (mark) continue;
		break;
	}
	for (int i = 0; i < n; i++) std::cout << a[i] << ' ';
	std::cout << '\n';
}

